package com.ecoolex.chinadutyfree.retailer.job.consumer;

import com.ecoolex.chinadutyfree.retailer.job.core.JOBConstant;
import com.ecoolex.chinadutyfree.retailer.job.core.MessageConstant;
import com.ecoolex.chinadutyfree.retailer.job.manager.OrderPushManager;
import com.ecoolex.framework.message.queue.Consumer;
import com.ecoolex.framework.message.queue.ConsumerComponent;
import com.ecoolex.framework.message.queue.Message;
import org.springframework.beans.factory.annotation.Autowired;

@ConsumerComponent
public class OrderPushConsumer {


	@Autowired
	OrderPushManager orderPushManager;

	@Consumer(group = JOBConstant.MODULE_NAME, theme = MessageConstant.ORDER_PUSH_THEME_NAME, describe = "创建订单推送消费记录")
	public void pushOrder(Message message) {
		String content = message.getContent();
		Integer orderId = Integer.valueOf(content);
		orderPushManager.push(orderId);
    }
}
